﻿function pageLoad(sender, args)
{

  elVal();
    $addHandler($get("btnSave"),"click",SaveNotification); 
}
//保存用户自定义通知信息
function SaveNotification()
{
    $get("btnSave").disabled = true;
    showProgressBar(true);
var Content=0;
// Content=$get("Checkbox1").value;
for(var i=1;i<8;i++)
{
if($("checkbox"+i)!=null)
{
    if($("checkbox"+i).checked)
    {
     Content +=parseInt($("checkbox"+i).value);
     }  
 } 
}
 var Content1="0";
 if ($("checkbox8").checked)
 {
    Content1=1;
 }


 WebServices.My.UpdateNotifications(MemberNo,Content,Content1,onsucc);

 }
function onsucc(result)
 {
   if(result)
   {
     $get("MessagesBox").style.display='';
      $get("MessageImg").src = MessageImageS;
        $get("MessageText").innerHTML = MessageTextS;
   }
   else
   {
   $get("MessagesBox").style.display='';
     $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = MessageTextF;
    }
     $get("btnSave").disabled = false;
    showProgressBar(false);
   
 }
 function Rend(divID)
{
    var domDiv1 = $get(divID);
   
   
    if(domDiv1!=null)
    {
        if($get("content")==null) return;
        var item= $get("content").innerHTML;
        var listBuilder = new Sys.StringBuilder();
       
     
            listBuilder.append(item);
        
        domDiv1.innerHTML = listBuilder.toString();
   }
}
//初始化参数Email选项默认值和通知选项默认值
function elVal()
{
   var my_array = new Array(1,2,4,8,16,32,64);
    var w=0;
    var j=1;
    for (i = 0; i < 8; i++)
        {
             w=my_array[i];
            if((emailVal&w)==w)
            {
                if($("checkbox"+j)!=null)
                {
                   $get("checkbox"+j).checked=true;
                }
            }
            j++;
         }
     if(letterVal=="1")
     {
        $get("checkbox8").checked=true;
     }        
}